<!--{eval $_G['home_tpl_titles'] = array(getstr($pic['title'], 60, 0, 0, 0, 0, -1), $album['albumname'], '{lang album}');}-->
<!--{eval $friendsname = array(1 => '{lang friendname_1}',2 => '{lang friendname_2}',3 => '{lang friendname_3}',4 => '{lang friendname_4}');}-->

<!--{if empty($diymode)}-->
<!--{template common/header}-->

<div id="pt" class="wp">
	<a href="index.php" class="nvhm">$_G[setting][bbname]</a> &rsaquo;
	<a href="home.php">$_G[setting][navs][4][navname]</a> &rsaquo; 
	<a href="home.php?mod=space&do=album">{lang album}</a> &rsaquo; 
	<a href="home.php?mod=space&uid=$space[uid]&do=album&view=me">{$space[username]}{lang somebody_album}</a>
</div>

<style id="diy_style" type="text/css"></style>
<div class="wp">
	<!--[diy=diy1]--><div id="diy1" class="area"></div><!--[/diy]-->
</div>

<!--{else}-->
<!--{template home/space_header}-->
<!--{/if}-->

<div id="ct" class="wp cl">
	<div class="mn">

<!--{if empty($diymode)}-->

		<div class="ch">
			<label class="wx"><a href="$_G[setting][navs][4][filename]">$_G[setting][navs][4][navname]</a></label>
			{hook/space_album_header}
		</div>
		<div class="bm">
		<!--{if $space[self]}-->
			<h1 class="mt"><img alt="album" src="{STATICURL}image/feed/album.gif" class="vm" /> {lang album} - $album[albumname]</h1>
			<ul class="tb cl">
				<li$actives[we]><a href="home.php?mod=space&uid=$space[uid]&do=album&view=we">{lang friend_album}</a></li>
				<li$actives[me]><a href="home.php?mod=space&uid=$space[uid]&do=album&view=me">{lang my_album}</a></li>
				<li$actives[all]><a href="home.php?mod=space&uid=$space[uid]&do=album&view=all">{lang view_all}</a></li>
				<li class="o"><a href="home.php?mod=spacecp&ac=upload&albumid=$pic[albumid]">{lang upload_pic}</a></li>
				<!--{if $_G[referer]}-->
				<li class="y"><a href="$_G[referer]">&laquo; {lang previous_page}</a></li>
				<!--{/if}-->
			</ul>
		<!--{else}-->
			<!--{eval
				$_G['home_tpl_spacemenus'][] = "<a href=\"home.php?mod=space&uid=$space[uid]&do=album&view=me\">{lang they_album}</a>";
				$_G['home_tpl_spacemenus'][] = "<a href=\"home.php?mod=space&uid=$space[uid]&do=album&id=$pic[albumid]\">$album[albumname]</a>";
				$_G['home_tpl_spacemenus'][] = "<a href=\"home.php?mod=space&uid=$space[uid]&do=album&picid=$pic[picid]\">{lang look_pic}</a>";
			}-->
			<!--{template home/space_menu}-->
		<!--{/if}-->

<!--{else}-->
		<div class="bm">
			<h1 class="mt">{lang album}</h1>
			<a href="home.php?mod=spacecp&ac=upload">{lang upload_pic}</a>
<!--{/if}-->


			<div class="tbmu" id="pic_block">
				<div class="y">
					<a href="home.php?mod=space&uid=$pic[uid]&do=$do&picid=$upid&goto=up#pic_block">{lang previous_pic}</a><span class="pipe">|</span>
					<a href="home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down#pic_block" id="nextlink">{lang next_pic}</a><span class="pipe">|</span>
					<!--{if $_GET['play']}-->
					<a href="javascript:;" id="playid" class="osld" onclick="playNextPic(false);">{lang stop_playing}</a>
					<!--{else}-->
					<a href="javascript:;" id="playid" class="osld" onclick="playNextPic(true);">{lang start_playing}</a>
					<!--{/if}--><span id="displayNum"></span>
				</div>
				<a href="home.php?mod=space&uid=$space[uid]&do=album&id=$pic[albumid]">&laquo; {lang return_pic_list}</a>
				<!--{if $album[picnum]}--><span class="pipe">|</span>{lang current_pic}<!--{/if}-->&nbsp;
				<!--{if $album['friend']}-->
				<span class="xg1"> &nbsp; {$friendsname[$value[friend]]}</span>
				<!--{/if}-->
				{hook/space_albumpic_top}
			</div>
			
			<div class="pns mlnv cl">
				<ul>
					<li><button type="button" class="pn" onclick="window.location.href='home.php?mod=space&uid=$pic[uid]&do=$do&picid=$upid&goto=up#pic_block'"><em>{lang previous_pic}</em></button></li>
					<!--{loop $piclist $value}-->
					<li>
						<a href="home.php?mod=space&uid=$value[uid]&do=album&picid=$value[picid]#pic_block"><img alt="" src="$value[pic]"{if $value[picid]==$picid} class="a"{/if} /></a>
					</li>
					<!--{/loop}-->
					<li><button type="button" class="pn" onclick="window.location.href='home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down#pic_block'"><em>{lang next_pic}</em></button></li>
				</ul>
			</div>

			<div class="vw pic">

				<div id="photo_pic" class="c{if $pic[magicframe]} magicframe magicframe$pic[magicframe]{/if}">
					<!--{if $pic[magicframe]}-->
					<div class="pic_lb1">
						<table cellpadding="0" cellspacing="0" class="">
							<tr>
								<td class="frame_jiao frame_top_left"></td>
								<td class="frame_x frame_top_middle"></td>
								<td class="frame_jiao frame_top_right"></td>
							</tr>
							<tr>
								<td class="frame_y frame_middle_left"></td>
								<td class="frame_middle_middle">
									<!--{/if}--><a href="home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down#pic_block"><img src="$pic[pic]" id="pic" alt="" /></a>
									<script type="text/javascript">
										function createElem(e){
											var obj = document.createElement(e);
											obj.style.position = 'absolute';
											obj.style.zIndex = '1';
											obj.style.cursor = 'pointer';
											obj.onmouseout = function(){ this.style.background = 'none';}
											return obj;
										}
										function viewPhoto(){
											var pre = createElem('div');
											var next = createElem('div');
											var cont = $('photo_pic');
											var tar = $('pic');
											var space = 0;
											var w = cont.offsetWidth/2;
											if(!!window.ActiveXObject && !window.XMLHttpRequest){
												space = -(cont.offsetWidth - tar.width)/2;
											}

											pre.style.left = space + 'px';
											next.style.left = space + w + 'px';
											pre.style.top = next.style.top = 0;

											pre.style.width = next.style.width = w + 'px';
											pre.style.height = next.style.height = tar.height + 'px';
											pre.innerHTML = next.innerHTML = '<img src="{IMGDIR}/emp.gif" width="' + w + '" height="' + tar.height + '" />';

											pre.onmouseover = function(){ this.style.background = 'url({IMGDIR}/pic-prev.gif) no-repeat 10px 50%'; }
											pre.onclick = function(){ window.location = 'home.php?mod=space&uid=$pic[uid]&do=$do&picid=$upid&goto=up#pic_block'; }

											next.onmouseover = function(){ this.style.background = 'url({IMGDIR}/pic-next.gif) no-repeat 94% 50%'; }
											next.onclick = function(){ window.location = 'home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down#pic_block'; }

											cont.style.position = 'relative';
											cont.appendChild(pre);
											cont.appendChild(next);
										}
										window.onload = function(){
											viewPhoto();
										}
									</script>
									<!--{if $pic[magicframe]}-->
								</td>
								<td class="frame_y frame_middle_right"></td>
							</tr>
							<tr>
								<td class="frame_jiao frame_bottom_left"></td>
								<td class="frame_x frame_bottom_middle"></td>
								<td class="frame_jiao frame_bottom_right"></td>
							</tr>
						</table>
					</div>
					<!--{/if}-->
				</div>

				<div class="d">
					<!--{if $pic[title]}--><p>$pic[title]</p><!--{/if}-->
					<p class="xg1">
						<!--{if $pic[hot]}--><span class="hot">{lang hot} <em>$pic[hot]</em></span><!--{/if}-->
						<!--{if $do=='event'}--><a href="home.php?mod=space&uid=$pic[uid]" target="_blank">$pic[username]</a><!--{/if}-->
						{lang upload_at} <!--{date($pic[dateline])}--> ($pic[size])
					</p>
					<!--{if isset($_GET['exif'])}-->
						<!--{if $exifs}-->
							<!--{loop $exifs $key $value}-->
								<!--{if $value}--><p>$key : $value</p><!--{/if}-->
							<!--{/loop}-->
						<!--{else}-->
							<p>{lang no_exif}</p>
						<!--{/if}-->
					<!--{/if}-->
					<p class="xs1">
						<a href="$pic[pic]" target="_blank">{lang look_pic}</a>
						<!--{if !isset($_GET['exif'])}-->
						<span class="pipe">|</span><a href="$theurl&exif">{lang look_exif}</a>
						<!--{/if}-->
						{hook/space_albumpic_bottom}
					</p>
				</div>

				<div class="o cl">
					<a href="home.php?mod=spacecp&ac=share&type=pic&id=$pic[picid]&handlekey=sharealbumhk_{$pic[picid]}" id="a_share_$pic[picid]" onclick="showWindow(this.id, this.href, 'get', 0);" class="oshr">{lang share}</a>

					{hook/space_albumpic_op_extra}
					<!--{if $pic[uid] == $_G[uid]}-->
					<!--{if $_G[magic][frame]}-->
						<img src="{STATICURL}image/magic/frame.small.gif" alt="frame" class="vm" />
						<!--{if $pic[magicframe]}-->
						<a id="a_magic_frame" href="home.php?mod=spacecp&ac=magic&op=cancelframe&idtype=picid&id=$pic[picid]" onclick="ajaxmenu(event,this.id)">{lang cancel_frame}</a>
						<!--{else}-->
						<a id="a_magic_frame" href="home.php?mod=magic&mid=frame&idtype=picid&id=$pic[picid]" onclick="ajaxmenu(event,this.id, 1)">{lang add_frame}</a>
						<!--{/if}-->
						<span class="pipe">|</span>
					<!--{/if}-->
					
					<!--{/if}-->

					<!--{if $_G[uid] == $pic[uid] || checkperm('managealbum')}-->
					<a href="home.php?mod=spacecp&ac=album&op=editpic&albumid=$pic[albumid]&picid=$pic[picid]">{lang manage_pic}</a><span class="pipe">|</span>
					<a href="home.php?mod=spacecp&ac=album&op=edittitle&albumid=$pic[albumid]&picid=$pic[picid]&handlekey=edittitlehk_{$pic[picid]}" id="a_set_title" onclick="showWindow(this.id, this.href, 'get', 0);">{lang edit_description}</a>
					<!--{/if}-->

					<!--{if checkperm('managealbum')}-->
					<span class="pipe">|</span>IP: $pic[postip]
					<span class="pipe">|</span><a href="home.php?mod=spacecp&ac=album&picid=$pic[picid]&op=edithot&handlekey=picedithothk_{$pic[picid]}" id="a_hot_$pic[picid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang hot}</a>
					<!--{/if}-->
					<!--a href="home.php?mod=spacecp&ac=common&op=report&idtype=picid&id=$pic[picid]&handlekey=reportpichk_{$pic[picid]}" id="a_report" onclick="showWindow(this.id, this.href, 'get', 0);">{lang report}</a-->
				</div>

			</div>

		</div>

		<div class="bm">
			<div id="click_div">
				<!--{template home/space_click}-->
			</div>
			<div id="pic_comment">
				<h3 class="pbn bbs">
					<!--{if !empty($list)}-->
					<a href="#quickcommentform_{$picid}" class="y xi2 xw0">{lang publish_comment}</a>
					<!--{/if}-->
					{lang comment}
				</h3>
				<div id="comment">
					<!--{if $cid}-->
					<div class="i">
						{lang current_comment}
					</div>
					<!--{/if}-->

					<div id="comment_ul" class="xld xlda">
					<!--{loop $list $value}-->
						<!--{template home/space_comment_li}-->
					<!--{/loop}-->
					</div>
				</div>
				<!--{if $multi}--><div class="pgs cl">$multi</div><!--{/if}-->
			</div>
		</div>

		<form id="quickcommentform_{$picid}" name="quickcommentform_{$picid}" action="home.php?mod=spacecp&ac=comment&handlekey=qcpic_{$picid}" method="post" autocomplete="off" onsubmit="ajaxpost('quickcommentform_{$picid}', 'return_qcpic_{$picid}');doane(event);" class="bm" style="width: 600px;">
			<p>
				<span id="comment_face" onclick="showFace(this.id, 'comment_message');return false;" style="cursor: pointer;"><img src="{IMGDIR}/facelist.gif" alt="facelist" class="vm" /></span>
				{hook/space_albumpic_face_extra}
				<!--{if !empty($_G['setting']['magics']['doodle'])}-->
				<a id="a_magic_doodle" href="home.php?mod=magic&mid=doodle&showid=comment_doodle&target=comment_message" onclick="showWindow(this.id, this.href, 'get', 0)"><img src="{STATICURL}image/magic/doodle.small.gif" alt="doodle" class="vm" /> $_G['setting']['magics']['doodle']</a>
				<!--{/if}-->
			</p>
			<div class="tedt mtn mbn">
				<div class="area">
					<textarea id="comment_message" onkeydown="ctrlEnter(event, 'commentsubmit_btn');" name="message" rows="3" class="pt"></textarea>
				</div>
			</div>
			<p class="pns">
				<input type="hidden" name="refer" value="$theurl" />
				<input type="hidden" name="id" value="$picid" />
				<input type="hidden" name="idtype" value="picid" />
				<input type="hidden" name="commentsubmit" value="true" />
				<input type="hidden" name="quickcomment" value="true" />
				<button type="submit" name="commentsubmit_btn" value="true" id="commentsubmit_btn" class="pn"><strong>{lang comment}</strong></button>
				<span id="__quickcommentform_{$picid}"></span>
				<span id="return_qcpic_{$picid}"></span>
				<input type="hidden" name="formhash" value="{FORMHASH}" />
			</p>
		</form>
		<script type="text/javascript">
			function succeedhandle_qcpic_{$picid}(url, msg, values) {
				if(values['cid']) {
					comment_add(values['cid']);
				} else {
					$('return_qcpic_{$picid}').innerHTML = msg;
				}
			}
		</script>

		<script type="text/javascript">
			var interval = 5000;
			var timerId = -1;
			var derId = -1;
			var replay = false;
			var num = 0;
			var endPlay = false;
			function forward() {
				window.location.href = 'home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down&play=1#pic_block';
			}
			function derivativeNum() {
				num++;
				$('displayNum').innerHTML = '[' + (interval/1000 - num) + ']';
			}
			function playNextPic(stat) {
				if(stat || replay) {
					derId = window.setInterval('derivativeNum();', 1000);
					$('displayNum').innerHTML = '[' + (interval/1000 - num) + ']';
					$('playid').onclick = function (){replay = false;playNextPic(false);};
					$('playid').innerHTML = '{lang stop_playing}';
					timerId = window.setInterval('forward();', interval);
				} else {
					replay = true;
					num = 0;
					if(endPlay) {
						$('playid').innerHTML = '{lang restart}';
					} else {
						$('playid').innerHTML = '{lang start_playing}';
					}
					$('playid').onclick = function (){playNextPic(true);};
					$('displayNum').innerHTML = '';
					window.clearInterval(timerId);
					window.clearInterval(derId);
				}
			}
			<!--{if $_GET['play']}-->
			<!--{if $sequence && $album['picnum']}-->
			if($sequence == $album[picnum]) {
				endPlay = true;
				playNextPic(false);
			} else {
				playNextPic(true);
			}
			<!--{else}-->
			playNextPic(true);
			<!--{/if}-->
			<!--{/if}-->

			function update_title() {
				$('title_form').style.display='';
			}

			var elems = selector('dd[class~=magicflicker]'); 
			for(var i=0; i<elems.length; i++){
				magicColor(elems[i]);
			}
		</script>

		<!--end bm-->


	</div>
	<div class="sd">

<!--{if empty($diymode)}-->
		<div class="ch">
			<label class="wx"><a href="$_G[setting][navs][4][filename]">$_G[setting][navs][4][navname]</a></label>
		</div>
		{subtemplate common/userabout}

		<div class="drag">
			<!--[diy=diy2]--><div id="diy2" class="area"></div><!--[/diy]-->
		</div>

<!--{else}-->
	{subtemplate home/space_userabout}
<!--{/if}-->
	</div>
</div>

<!--{if empty($diymode)}-->
<div class="wp mtn">
	<!--[diy=diy3]--><div id="diy3" class="area"></div><!--[/diy]-->
</div>
<!--{/if}-->

<!--{template common/footer}-->